/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.controlstudent.android.app;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Batkev
 */
public class MenuAsistencia extends Activity {
	private Spinner spinner1;
	private List<String> lista;
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.menuasi);
        // ToDo add your GUI initialization code here   
        DatosPorDefecto();
       
    }
    
    
    	private void DatosPorDefecto() {
		// TODO Auto-generated method stub
		spinner1 = (Spinner) findViewById(R.id.spinner1);

		lista = new ArrayList<String>();
		spinner1 = (Spinner) this.findViewById(R.id.spinner1);
		lista.add("Marzo");
		lista.add("Abril");
		lista.add("Mayo");
		lista.add("Junio");
		lista.add("Julio");
		lista.add("Agosto");
                lista.add("Setiembre");
                lista.add("Octubre");
                lista.add("Noviembre");
                lista.add("Diciembre");
                
		ArrayAdapter<String> adaptador = new ArrayAdapter<String>(this,
				android.R.layout.simple_spinner_item, lista);
		adaptador
				.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		spinner1.setAdapter(adaptador);

		spinner1.setOnItemSelectedListener(new OnItemSelectedListener() {

			@Override
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int arg2, long arg3) {
				Toast.makeText(arg0.getContext(),
						"Seleccionado: " + arg0.getItemAtPosition(arg2).toString(),
						Toast.LENGTH_SHORT).show();
			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {

			}

                  

		});

	}
    
    
  
}
    

